package main

import (
	"fmt"
	"go-learning-process/4.接口/mock"
)

type Retriever interface {
	Get(url string) string
}

func download(r Retriever) string {
	return r.Get("www.fangkang.top")
}

func main() {
	var r Retriever
	r = mock.Retriever{"this is kaka coding"}
	// mock.Retriever {this is kaka coding}
	fmt.Printf("%T %v", r, r)
	//fmt.Println(download(r))

	switch v := r.(type) {
	case mock.Retriever:
		// Contents: this is kaka coding
		fmt.Println("Contents:", v.Contents)
	}
}
